<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>拼手气</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />

<script type="text/javascript" src="__PUBLIC__/js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery.rotate.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/scroll.js"></script>



<link href="__PUBLIC__/Weixin/css/index.css?v={:rand(0,99)}" rel="stylesheet" type="text/css">

<link href="__PUBLIC__/Weixin/css/head.css?v={:rand(0,99)}" rel="stylesheet" type="text/css">
   <link href="/bao/css/style.css" type="text/css" rel="stylesheet" />
 

<style></style>

<script>

$(document).ready(function () { 
	<?php if($sysconfig['chongnum'] > 0 && $sysconfig['songqian'] > 0){ ?> 
	$('.msgbox .txt').text('再充值<?php echo $sysconfig['chongnum']-$user['cishu'];?>次送{$sysconfig.songqian}元!');
	$('.msgbox').show();
	<?php }?>
      
    $(function(){

	    

	});
  	
  	var i = 0;
    $('.hb2 li').click(function(){
		
        $(this).unbind();
		$('#dengdai').show();
        //$(this).unbind();
		
		var chaiact = $("input[name='chaiact']").val();

		if(chaiact ==2){return false;}

		$("input[name='chaiact']").val(2);

		var h =$(this).find('p').text();

		var p = $(this);
       // $.ajaxSettings.async = true;
      	if(i == 0){
		$.post("{:U('ajaxchai')}",{hbid:{$hbid|intval}},function(res){
			
		    //alert(JSON.stringify(res));
            $('#dengdai').hide();
		   if(res.code==1){

			   $("input[name='chaiact']").val(1);

			   $('.msgbox .txt').text('请先支付！');

		       $('.msgbox').show();

			   $("input[name='msgbox']").val(1);

		   }

		   if(res.code == 2) {

		      p.css('height',p.height());

		      p.empty();

			  $('.msgbox .txt').text('恭喜您获得 '+res.hbe+' 元，已自动转到微信余额!');

		      $('.msgbox').show();
			  $('.msgbox .but').css("display","none");
			  $('.msgbox .box').append("<span class='countdown' style='color:red'>5</span>");
			  var i= 4;
			  setInterval(function(){
			  	$('.msgbox .box .countdown').text(i)
				i--;
				if(i<0){
					$('.msgbox .but').click();
				}
			  }, 1000);

			  $("input[name='msgbox']").val(1);
			  $("input[name='price']").val(res.hbe);         
			  if(h!=res.hbe){

				   $('.hb2 li').each(function(index, element) {

                        var s=$(this).find('p').text();

						if(s==res.hbe){

							$(this).find('p').text(h);

						}

                   });

			  }

		      $('.hb2 .chai').hide();

		      $('.hb2 .xian').show();

		   }

		   if(res.code == 3){

			  $("input[name='chaiact']").val(1); 

			  $('.msgbox .txt').text('系统频繁，请稍候再试');

		      $('.msgbox').show();

		   }

		   if(res.code == 4){

			  $("input[name='chaiact']").val(1);

			  $('.msgbox .txt').text('今天次数已经没有了，请明天再来！');

		      $('.msgbox').show();

		   }

		   if(res.code == 5){

			  $("input[name='chaiact']").val(1); 

			  $('.msgbox .txt').text('红包准备中，请等待！');

		      $('.msgbox').show();

		   }
         

		},'json');
          
        }
      
       i++;
          

	});
	

	//});


});

</script>

</head>
  <body class="main_background">
        <div class="box padding_bottom02">
            <div class="top_02">
                 <img src="/bao/picture/top_bg.png" />
            </div>
            <div class="guang">
                <img id="img" src="/bao/picture/guang.png" />
            </div>
            <script type="text/javascript">
                $(document).ready(function() {
                    var angle = 0;
                    setInterval(function() {
                        angle += 3;
                        $("#img").rotate(angle);
                    },
                    100);
                });
            </script>
            <div class="center">
                <div class="c_b background_white b_r no_pt cb_p">
                    <div style="margin-bottom: 10px;margin-top: 25px;">
                        <div style="width: 100%;height:0px;line-height:20px;padding-top: 5px;padding-bottom: 5px;">
                            <div style="margin-left: 0;margin-right: 5px;">
                                <ul id="marquee" class="marquee" style="font-size: 15px;">
                                    <li>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
<body>

<input type="hidden" value="1" name="chaiact">

<!--1可拆2锁定--> 








 <h3 class="title no_margin font_red t_p">
                        点击拆红包
                    </h3>
 

<div class="hb2">

  <ul>

    <foreach name="chaihbcon" item="v">

      <li><img src="/bao/picture/11.gif" class="chai"> <img src="/bao/picture/110.png" class="xian">

        <P class="xian">{$v/100}</P>

      </li>

    </foreach>

  </ul>

</div>

<include file="Index/meno" />

</body>
